// 管理员登录接口
const express = require('express');
const router = express.Router();
const db = require('../../db/connect');
const xzid = require('xzid')

router.post('/admin/updateAdmin', (req, res) => {
    const {img,name,password,id} = req.body;
    const sql = `UPDATE manger_admin SET username = ?,password = ?,img=?  WHERE admin_id = ?;
    `;
    db(sql,[name,password,img,id] ,(err, data) => {
        if (data.affectedRows !== 0) {
           res.send({
                data,
                code:200
           })
        } else {
            res.send({
                code: 400,
                content: err,
                message: '告诉他账户不存在'
            })
        }
    })
})
module.exports = router